<div class="form-group">
    <label class="col-sm-2 control-label" for="field-1">包房名称</label>

    <div class="col-sm-10">
        <input type="text" name="room.roomName" class="form-control" placeholder="请输入包房名称"
               data-validate="required" value="${room?.roomName}">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label" for="field-1">供应商</label>

    <div class="col-sm-10">
        <input id="idAdminSupplierId" type="hidden" name="room.adminSupplier.id" value="${room?.adminSupplier?.id}">
        <input id="idAdminSupplierName" readonly onclick="checkSupplier()" type="text" class="form-control" placeholder="点击选择供应商"
               data-validate="required" value="${room?.adminSupplier?.name}">
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-3">包房图片</label>

    <div class="col-sm-10">
        <p style="color: red">注:只能上传4:3分辨率的图片</p>
        <input type="file" class="form-control" name="roomImage" id="roomImage" data-validate="${room?.roomImage == null || room?.roomImage == '' ? 'required' : ''}">
    </div>
</div>

#{if room?.roomImage != null && room?.roomImage != ''}
<div class="form-group">
    <label class="col-sm-2 control-label" for="field-3"></label>

    <div class="col-sm-10">
        <img src="${room?.roomImage}" style="width: 100px">
    </div>
</div>

#{/if}

<!--<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-1">价格(元/小时)</label>

    <div class="col-sm-10">
        <input type="text" name="room.perPrice" class="form-control" placeholder="0"
               data-validate="required" value="${room?.perPrice}">
    </div>
</div>-->

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label">计费模式</label>

    <div class="col-sm-10">
        <label class="radio-inline">
            <input type="radio"  name="room.chargeMode" ${room?.chargeMode.toString() == 'TIMES' ? 'checked' : ''} value="TIMES">
            次
        </label>
        <label class="radio-inline">
            <input type="radio"  name="room.chargeMode" ${room?.chargeMode.toString() == 'MINUTE' ? 'checked' : ''} value="MINUTE">
            分钟
        </label>
        <label class="radio-inline">
            <input type="radio"  name="room.chargeMode" ${room?.chargeMode.toString() == 'TEN_MINUTE' ? 'checked' : ''} value="TEN_MINUTE">
            十分钟
        </label>
        <label class="radio-inline">
            <input type="radio"  name="room.chargeMode" ${room?.chargeMode.toString() == 'HALF_HOUR' ? 'checked' : ''} value="HALF_HOUR">
            半小时
        </label>
        <label class="radio-inline">
            <input type="radio"  name="room.chargeMode" ${room?.chargeMode.toString() == 'HOUR' ? 'checked' : ''} value="HOUR">
            小时
        </label>
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-2">备注</label>

    <div class="col-sm-10">
        <textarea class="form-control" cols="5" id="field-5" name="room.remark" placeholder="请输入备注">${room?.remark}</textarea>
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-5"></label>

    <div class="col-sm-10">
        <button type="submit" class="btn btn-success">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>
        <button type="reset" class="btn btn-white">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
    </div>

</div>

<script type="text/javascript">
    function checkSupplier() {
        layer.open({
            title:"供应商选择",
            type: 2,
            area: ['400px', '500px'],
            fixed: true,
            maxmin: false,
            content: '/warehouse/AdminSupplierCtrl/popAdminSuppliers'
        });
    }


    function callBack(id , name) {
        $('#idAdminSupplierId').val(id);
        $('#idAdminSupplierName').val(name);
        layer.closeAll();
    }

</script>